package br.com.o2solutions.core.test.business;

import org.junit.Ignore;
import org.springframework.beans.factory.annotation.Autowired;

import br.com.o2solutions.core.aop.business.annotation.ApplyRule;
import br.com.o2solutions.core.aop.business.annotation.Business;
import br.com.o2solutions.core.aop.business.annotation.RestrictRules;
import br.com.o2solutions.core.business.BasicBusinessSupport;
import br.com.o2solutions.core.exception.BusinessException;
import br.com.o2solutions.core.integration.repository.DataBaseIntegration;
import br.com.o2solutions.core.test.business.rule.HibernateAnnotationsValidatorRule;
import br.com.o2solutions.core.test.business.rule.RemoveRule;
import br.com.o2solutions.core.test.business.rule.SaveRule;
import br.com.o2solutions.core.test.business.rule.UpdateRule;
import br.com.o2solutions.core.test.business.rule.VerifyNotIgnoredStringRule;
import br.com.o2solutions.core.test.business.rule.VerifyStringRule;
import br.com.o2solutions.core.test.model.ModelTest;

@Ignore
@Business("basicBusiness")
public class BasicBusinessImpl extends BasicBusinessSupport<ModelTest> {

	@Override
	@Autowired
	public void setDataBaseIntegration(
			DataBaseIntegration<ModelTest> dataBaseIntegration) {
		super.setDataBaseIntegration(dataBaseIntegration);
	}

	@Override
	@ApplyRule(rules = UpdateRule.class)
	public void update(ModelTest entity) throws BusinessException {
		super.update(entity);
	}

	@Override
	@ApplyRule(rules = SaveRule.class)
	public void save(ModelTest entity) throws BusinessException {
		super.save(entity);
	}

	@Override
	@ApplyRule(rules = RemoveRule.class)
	public void remove(ModelTest entity) throws BusinessException {
		super.remove(entity);
	}

	@ApplyRule(rules = { VerifyStringRule.class,
			VerifyNotIgnoredStringRule.class })
	public void checkApplyRestrictRule(
			@RestrictRules(restrictTo = { VerifyStringRule.class }) String paramOne,
			String paramTwo) {

	}

	@ApplyRule(rules = { HibernateAnnotationsValidatorRule.class })
	public void validateHibernate(ModelTest modelTest) throws BusinessException {
	}

}